package com.education.db.domain;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by Fan on 2016/9/26.
 */
@Entity
@Table(name = "info_user", schema = "db_education", catalog = "")
public class InfoUser {
    private int usId;
    private String usPhone;
    private String usPassword;
    private byte usType;
    private Timestamp usRegdate;

    @Id
    @Column(name = "us_id")
    public int getUsId() {
        return usId;
    }

    public void setUsId(int usId) {
        this.usId = usId;
    }

    @Basic
    @Column(name = "us_phone")
    public String getUsPhone() {
        return usPhone;
    }

    public void setUsPhone(String usPhone) {
        this.usPhone = usPhone;
    }

    @Basic
    @Column(name = "us_password")
    public String getUsPassword() {
        return usPassword;
    }

    public void setUsPassword(String usPassword) {
        this.usPassword = usPassword;
    }

    @Basic
    @Column(name = "us_type")
    public byte getUsType() {
        return usType;
    }

    public void setUsType(byte usType) {
        this.usType = usType;
    }

    @Basic
    @Column(name = "us_regdate")
    public Timestamp getUsRegdate() {
        return usRegdate;
    }

    public void setUsRegdate(Timestamp usRegdate) {
        this.usRegdate = usRegdate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        InfoUser infoUser = (InfoUser) o;

        if (usId != infoUser.usId) return false;
        if (usType != infoUser.usType) return false;
        if (usPhone != null ? !usPhone.equals(infoUser.usPhone) : infoUser.usPhone != null) return false;
        if (usPassword != null ? !usPassword.equals(infoUser.usPassword) : infoUser.usPassword != null) return false;
        if (usRegdate != null ? !usRegdate.equals(infoUser.usRegdate) : infoUser.usRegdate != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = usId;
        result = 31 * result + (usPhone != null ? usPhone.hashCode() : 0);
        result = 31 * result + (usPassword != null ? usPassword.hashCode() : 0);
        result = 31 * result + (int) usType;
        result = 31 * result + (usRegdate != null ? usRegdate.hashCode() : 0);
        return result;
    }
}
